3.226 \(\int \frac {\tan (e+f x)}{(a+b \tan ^2(e+f x))^2} \, dx\)

Optimal. Leaf size=65 \[ \frac {1}{2 f (a-b) \left (a+b \tan ^2(e+f x)\right )}-\frac {\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 f (a-b)^2} \]

[Out]

-1/2*ln(a*cos(f*x+e)^2+b*sin(f*x+e)^2)/(a-b)^2/f+1/2/(a-b)/f/(a+b*tan(f*x+e)^2)

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3670, 444, 44} \[ \frac {1}{2 f (a-b) \left (a+b \tan ^2(e+f x)\right )}-\frac {\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 f (a-b)^2} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]/(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-Log[a*Cos[e + f*x]^2 + b*Sin[e + f*x]^2]/(2*(a - b)^2*f) + 1/(2*(a - b)*f*(a + b*Tan[e + f*x]^2))

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 444

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] && NeQ[b*c - a*d, 0] && EqQ[m
- n + 1, 0]

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps

\begin {align*} \int \frac {\tan (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x}{\left (1+x^2\right ) \left (a+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \frac {1}{(1+x) (a+b x)^2} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac {\operatorname {Subst}\left (\int \left (\frac {1}{(a-b)^2 (1+x)}-\frac {b}{(a-b) (a+b x)^2}-\frac {b}{(a-b)^2 (a+b x)}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=-\frac {\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 (a-b)^2 f}+\frac {1}{2 (a-b) f \left (a+b \tan ^2(e+f x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.66, size = 57, normalized size = 0.88 \[ -\frac {\frac {b-a}{a+b \tan ^2(e+f x)}+\log \left (a+b \tan ^2(e+f x)\right )+2 \log (\cos (e+f x))}{2 f (a-b)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]/(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-1/2*(2*Log[Cos[e + f*x]] + Log[a + b*Tan[e + f*x]^2] + (-a + b)/(a + b*Tan[e + f*x]^2))/((a - b)^2*f)

________________________________________________________________________________________

fricas [A]  time = 0.45, size = 98, normalized size = 1.51 \[ -\frac {b \tan \left (f x + e\right )^{2} + {\left (b \tan \left (f x + e\right )^{2} + a\right )} \log \left (\frac {b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right ) + b}{2 \, {\left ({\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} f \tan \left (f x + e\right )^{2} + {\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} f\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-1/2*(b*tan(f*x + e)^2 + (b*tan(f*x + e)^2 + a)*log((b*tan(f*x + e)^2 + a)/(tan(f*x + e)^2 + 1)) + b)/((a^2*b
- 2*a*b^2 + b^3)*f*tan(f*x + e)^2 + (a^3 - 2*a^2*b + a*b^2)*f)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)2/f*(1/(2*a^2-4*a*b+2*b^2)*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1))-1/(4*a^2-8*a*b+4*b^2)*ln(((1
-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a-2*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a+4*(1-cos(f*x+exp(1)))/(
1+cos(f*x+exp(1)))*b+a)+(((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a^2-2*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(
1)))*a^2+4*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*b^2+a^2)/(4*a^3-8*a^2*b+4*a*b^2)/(((1-cos(f*x+exp(1)))/(1+c
os(f*x+exp(1))))^2*a-2*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a+4*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*b+a
))

________________________________________________________________________________________

maple [A]  time = 0.21, size = 104, normalized size = 1.60 \[ -\frac {\ln \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )}{2 f \left (a -b \right )^{2}}+\frac {a}{2 f \left (a -b \right )^{2} \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )}-\frac {b}{2 f \left (a -b \right )^{2} \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (a -b \right )^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)/(a+b*tan(f*x+e)^2)^2,x)

[Out]

-1/2/f/(a-b)^2*ln(a+b*tan(f*x+e)^2)+1/2/f/(a-b)^2*a/(a+b*tan(f*x+e)^2)-1/2/f*b/(a-b)^2/(a+b*tan(f*x+e)^2)+1/2/
f/(a-b)^2*ln(1+tan(f*x+e)^2)

________________________________________________________________________________________

maxima [A]  time = 0.64, size = 88, normalized size = 1.35 \[ -\frac {\frac {b}{a^{3} - 2 \, a^{2} b + a b^{2} - {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} \sin \left (f x + e\right )^{2}} + \frac {\log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a^{2} - 2 \, a b + b^{2}}}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

-1/2*(b/(a^3 - 2*a^2*b + a*b^2 - (a^3 - 3*a^2*b + 3*a*b^2 - b^3)*sin(f*x + e)^2) + log(-(a - b)*sin(f*x + e)^2
 + a)/(a^2 - 2*a*b + b^2))/f

________________________________________________________________________________________

mupad [B]  time = 11.64, size = 195, normalized size = 3.00 \[ -\frac {b\,\left (1+{\mathrm {tan}\left (e+f\,x\right )}^2\,\mathrm {atan}\left (\frac {a\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}-b\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}}{2\,a+a\,{\mathrm {tan}\left (e+f\,x\right )}^2+b\,{\mathrm {tan}\left (e+f\,x\right )}^2}\right )\,2{}\mathrm {i}\right )+a\,\left (-1+\mathrm {atan}\left (\frac {a\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}-b\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}}{2\,a+a\,{\mathrm {tan}\left (e+f\,x\right )}^2+b\,{\mathrm {tan}\left (e+f\,x\right )}^2}\right )\,2{}\mathrm {i}\right )}{f\,\left (2\,a^3+2\,a^2\,b\,{\mathrm {tan}\left (e+f\,x\right )}^2-4\,a^2\,b-4\,a\,b^2\,{\mathrm {tan}\left (e+f\,x\right )}^2+2\,a\,b^2+2\,b^3\,{\mathrm {tan}\left (e+f\,x\right )}^2\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(e + f*x)/(a + b*tan(e + f*x)^2)^2,x)

[Out]

-(b*(tan(e + f*x)^2*atan((a*tan(e + f*x)^2*1i - b*tan(e + f*x)^2*1i)/(2*a + a*tan(e + f*x)^2 + b*tan(e + f*x)^
2))*2i + 1) + a*(atan((a*tan(e + f*x)^2*1i - b*tan(e + f*x)^2*1i)/(2*a + a*tan(e + f*x)^2 + b*tan(e + f*x)^2))
*2i - 1))/(f*(2*a*b^2 - 4*a^2*b + 2*a^3 + 2*b^3*tan(e + f*x)^2 - 4*a*b^2*tan(e + f*x)^2 + 2*a^2*b*tan(e + f*x)
^2))

________________________________________________________________________________________

sympy [A]  time = 26.39, size = 816, normalized size = 12.55 \[ \begin {cases} \frac {\tilde {\infty } x}{\tan ^{3}{\relax (e )}} & \text {for}\: a = 0 \wedge b = 0 \wedge f = 0 \\- \frac {1}{4 b^{2} f \tan ^{4}{\left (e + f x \right )} + 8 b^{2} f \tan ^{2}{\left (e + f x \right )} + 4 b^{2} f} & \text {for}\: a = b \\\frac {x \tan {\relax (e )}}{\left (a + b \tan ^{2}{\relax (e )}\right )^{2}} & \text {for}\: f = 0 \\\frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a^{2} f} & \text {for}\: b = 0 \\- \frac {a \log {\left (- i \sqrt {a} \sqrt {\frac {1}{b}} + \tan {\left (e + f x \right )} \right )}}{2 a^{3} f + 2 a^{2} b f \tan ^{2}{\left (e + f x \right )} - 4 a^{2} b f - 4 a b^{2} f \tan ^{2}{\left (e + f x \right )} + 2 a b^{2} f + 2 b^{3} f \tan ^{2}{\left (e + f x \right )}} - \frac {a \log {\left (i \sqrt {a} \sqrt {\frac {1}{b}} + \tan {\left (e + f x \right )} \right )}}{2 a^{3} f + 2 a^{2} b f \tan ^{2}{\left (e + f x \right )} - 4 a^{2} b f - 4 a b^{2} f \tan ^{2}{\left (e + f x \right )} + 2 a b^{2} f + 2 b^{3} f \tan ^{2}{\left (e + f x \right )}} + \frac {a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a^{3} f + 2 a^{2} b f \tan ^{2}{\left (e + f x \right )} - 4 a^{2} b f - 4 a b^{2} f \tan ^{2}{\left (e + f x \right )} + 2 a b^{2} f + 2 b^{3} f \tan ^{2}{\left (e + f x \right )}} + \frac {a}{2 a^{3} f + 2 a^{2} b f \tan ^{2}{\left (e + f x \right )} - 4 a^{2} b f - 4 a b^{2} f \tan ^{2}{\left (e + f x \right )} + 2 a b^{2} f + 2 b^{3} f \tan ^{2}{\left (e + f x \right )}} - \frac {b \log {\left (- i \sqrt {a} \sqrt {\frac {1}{b}} + \tan {\left (e + f x \right )} \right )} \tan ^{2}{\left (e + f x \right )}}{2 a^{3} f + 2 a^{2} b f \tan ^{2}{\left (e + f x \right )} - 4 a^{2} b f - 4 a b^{2} f \tan ^{2}{\left (e + f x \right )} + 2 a b^{2} f + 2 b^{3} f \tan ^{2}{\left (e + f x \right )}} - \frac {b \log {\left (i \sqrt {a} \sqrt {\frac {1}{b}} + \tan {\left (e + f x \right )} \right )} \tan ^{2}{\left (e + f x \right )}}{2 a^{3} f + 2 a^{2} b f \tan ^{2}{\left (e + f x \right )} - 4 a^{2} b f - 4 a b^{2} f \tan ^{2}{\left (e + f x \right )} + 2 a b^{2} f + 2 b^{3} f \tan ^{2}{\left (e + f x \right )}} + \frac {b \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan ^{2}{\left (e + f x \right )}}{2 a^{3} f + 2 a^{2} b f \tan ^{2}{\left (e + f x \right )} - 4 a^{2} b f - 4 a b^{2} f \tan ^{2}{\left (e + f x \right )} + 2 a b^{2} f + 2 b^{3} f \tan ^{2}{\left (e + f x \right )}} - \frac {b}{2 a^{3} f + 2 a^{2} b f \tan ^{2}{\left (e + f x \right )} - 4 a^{2} b f - 4 a b^{2} f \tan ^{2}{\left (e + f x \right )} + 2 a b^{2} f + 2 b^{3} f \tan ^{2}{\left (e + f x \right )}} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*tan(f*x+e)**2)**2,x)

[Out]

Piecewise((zoo*x/tan(e)**3, Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), (-1/(4*b**2*f*tan(e + f*x)**4 + 8*b**2*f*tan(e +
f*x)**2 + 4*b**2*f), Eq(a, b)), (x*tan(e)/(a + b*tan(e)**2)**2, Eq(f, 0)), (log(tan(e + f*x)**2 + 1)/(2*a**2*f
), Eq(b, 0)), (-a*log(-I*sqrt(a)*sqrt(1/b) + tan(e + f*x))/(2*a**3*f + 2*a**2*b*f*tan(e + f*x)**2 - 4*a**2*b*f
 - 4*a*b**2*f*tan(e + f*x)**2 + 2*a*b**2*f + 2*b**3*f*tan(e + f*x)**2) - a*log(I*sqrt(a)*sqrt(1/b) + tan(e + f
*x))/(2*a**3*f + 2*a**2*b*f*tan(e + f*x)**2 - 4*a**2*b*f - 4*a*b**2*f*tan(e + f*x)**2 + 2*a*b**2*f + 2*b**3*f*
tan(e + f*x)**2) + a*log(tan(e + f*x)**2 + 1)/(2*a**3*f + 2*a**2*b*f*tan(e + f*x)**2 - 4*a**2*b*f - 4*a*b**2*f
*tan(e + f*x)**2 + 2*a*b**2*f + 2*b**3*f*tan(e + f*x)**2) + a/(2*a**3*f + 2*a**2*b*f*tan(e + f*x)**2 - 4*a**2*
b*f - 4*a*b**2*f*tan(e + f*x)**2 + 2*a*b**2*f + 2*b**3*f*tan(e + f*x)**2) - b*log(-I*sqrt(a)*sqrt(1/b) + tan(e
 + f*x))*tan(e + f*x)**2/(2*a**3*f + 2*a**2*b*f*tan(e + f*x)**2 - 4*a**2*b*f - 4*a*b**2*f*tan(e + f*x)**2 + 2*
a*b**2*f + 2*b**3*f*tan(e + f*x)**2) - b*log(I*sqrt(a)*sqrt(1/b) + tan(e + f*x))*tan(e + f*x)**2/(2*a**3*f + 2
*a**2*b*f*tan(e + f*x)**2 - 4*a**2*b*f - 4*a*b**2*f*tan(e + f*x)**2 + 2*a*b**2*f + 2*b**3*f*tan(e + f*x)**2) +
 b*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(2*a**3*f + 2*a**2*b*f*tan(e + f*x)**2 - 4*a**2*b*f - 4*a*b**2*f*t
an(e + f*x)**2 + 2*a*b**2*f + 2*b**3*f*tan(e + f*x)**2) - b/(2*a**3*f + 2*a**2*b*f*tan(e + f*x)**2 - 4*a**2*b*
f - 4*a*b**2*f*tan(e + f*x)**2 + 2*a*b**2*f + 2*b**3*f*tan(e + f*x)**2), True))

________________________________________________________________________________________